package design.simdi.code.final_paper.site.panels.proiecte.keywords;

import org.apache.wicket.model.LoadableDetachableModel;

import design.simdi.code.final_paper.core.daos.KeywordDao;
import design.simdi.code.final_paper.core.entities.Keyword;

/**
 * 
 * @author Marius Dumitriu - (Jun 21, 2010 - 3:29:36 PM)
 * 
 */
public class DetachableKeywordModel extends LoadableDetachableModel<Keyword> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final long id;
	private final KeywordDao keywordDao;

	public DetachableKeywordModel(Keyword object, KeywordDao keywordDao) {
		super(object);
		this.id = object.getId();
		this.keywordDao = keywordDao;
	}

	@Override
	protected Keyword load() {
		return keywordDao.get(id);
	}

}
